package com.qf.webmaster.feign;

import com.qf.webmaster.entity.User;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.*;

/*
为了和Search服务的controller接口做映射。
 */
@FeignClient(value = "SEARCH",fallbackFactory = SearchClientFallbackFactory.class)
public interface SearchClient {

    /*
    RequestMapping：
      value：映射完整的请求路径
      method：映射请求方式
     */
    @GetMapping("/search/hello")
    String hello();

    @RequestMapping(value = "/search/find/{id}")
    String findById(@PathVariable String id);

    @RequestMapping("/search/find")
    String findByCondition(@RequestParam String name,@RequestParam String age);

    @PostMapping("/search/save")
    String save(User user);



}
